
    	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
	
	
	<script type="text/javascript" >
	
			function moremodeldisplay(id){
				
				$.ajax({
					url:'more.php?action=model',
					type:'post',
					data: 'id='+id,
					beforeSend:function(){
						$('#more_popup').html('<div class="error" style="padding:30px;"><img  src="BootCommerce Demo_files/loader.gif" alt="Loading..." align="middle"/></div>');       
					},
					success:function(data){
						$("#more_popup").html(data);
						document.getElementById('more_popup').style.display='block';
					}
				});
			}
			
			function addtocart(id){
				var ids = id.split("_");
				var id= ids[1];
				$.ajax({
					url:'cart-control.php?action=add',
					type:'post',
					data: 'id='+id,
					beforeSend:function(){
						$('#load_more_gif').css("display","block");      
					},
					success:function(data){
						$('#item_added_msg_popup').css("display","block");
						$('#added_msg').html("The item was successfully added to the Cart"); 
						topcartreload();
					}
				});
			}
			function addtowish(id){
				var ids = id.split("_");
				var id= ids[1];
				$.ajax({
					url:'cart-control.php?action=wishadd',
					type:'post',
					data: 'id='+id,
					beforeSend:function(){
						$('#more_popup').html('<div class="error" style="padding:30px;"><img  src="BootCommerce Demo_files/loader.gif" alt="Loading..." align="middle"/></div>');       
					},
					success:function(data){
					alert(data);
						if(data == "failure"){
							alert("please login to continue adding wishlist");
						}else{
							$('#item_added_msg_popup').css("display","block");  
							$('#added_msg').html("The item was successfully added to the Wishlist");  
						}
					}
				});
			}
	</script>		
	<!--image hover text overlay css and js-->
	
	<link rel="stylesheet" href="hover/css/style.css" />
	<link rel="stylesheet" href="hover/css/custom.css" />
	<script src="hover/js/jquery-1.9.1.min.js" type="text/javascript"></script>	
	<script src="hover/js/modernizr.js" ></script>
			
			<script type="text/javascript">
				$(document).ready(function(){
				
				$("#messages-list .span4").css("clear","none");
				
					if (Modernizr.touch) {
						// show the close overlay button
						$(".close-overlay").removeClass("hidden");
						// handle the adding of hover class when clicked
						$(".img").click(function(e){
							if (!$(this).hasClass("hover")) {
								$(this).addClass("hover");
							}
						});
						// handle the closing of the overlay
						$(".close-overlay").click(function(e){
							e.preventDefault();
							e.stopPropagation();
							if ($(this).closest(".img").hasClass("hover")) {
								$(this).closest(".img").removeClass("hover");
							}
						});
					} else {
						// handle the mouseenter functionality
						$(".img").mouseenter(function(){
							$(this).addClass("hover");
						})
						// handle the mouseleave functionality
						.mouseleave(function(){
							$(this).removeClass("hover");
						});
					}
				});
			</script>

	
<?php
if(isset($_GET['action']) == "loadmore"){
require('include/connect.php');

if( isset( $_POST['p'] ) )
{
	$catid = $_GET['catid'];
	$page					=	intval( $_POST['p'] );
	$current_page			=	$page - 1;
	$records_per_page		=	30; // records to show per page
	$start					=	$current_page * $records_per_page;
	$query					=	"SELECT * from product where `CategoryID` =$catid order by ProductID DESC LIMIT $start, $records_per_page";
	$result					=	mysqli_query($con,$query);
	$html					=	"";
	while ( $row = mysqli_fetch_array($result,MYSQLI_ASSOC) ) 
	{
		$PID1 = $row['ProductID'];
		$im    = $row['SmallImage'];
		if($PID1>12310)
			{
				$im= substr($im, 0, -4);
				$im="poster/".$im."_thumbnail.jpg";
			}
			else if($PID1<=12310)
			{
				$im="poster/".$im;
			}
		$html	.= " <div style='' class='row-fluid'>
                   <div class='span12'>
                    <article class='product-container-list' data-exstend-link='on'> 
                      <div class='row-fluid'>
                         <section class='product-img span4'>
							                     
                           <div class='img-thumb'> 
                                                                                                            
                             <a href=''><img style='display: inline;' class='lazy' src='http://q8movies.com/".$im."' alt='product1'></a>
                           </div>
                         </section>
                         <section class='product-detail-container text-left span8'>
                          <div class='row-fluid'>
                             <div >
                               <section class='product-name' title='product1'><b>".$row['ProductName']."</b></section>
                              
                             </div>
                             <div >
										
									<div>
										<img  src='img/add_to_cart_btn.jpg'id='img_".$PID1."' data-rel-name='".$row['ProductName']."' data-rel-img='http://q8movies.com/".$im."'  data-id='".$PID1."' onclick='addtocart(this.id);' style='cursor:pointer;'>
										<img  src='img/add_to_wish_btn.jpg' id='wish_".$PID1."' data-rel-name='".$row['ProductName']."' data-rel-img='http://q8movies.com/".$im."'  data-id='".$PID1."' onclick='addtowish(this.id);' style='cursor:pointer;'>
									</div>
									
												<div style='padding:20px;' >
													<div style='float:left;'>
														<p style='color:black;'><b>52 Views</b></p>
														<p style='color:black;'><b>10 Likes</b></p>
													</div>
													
													<div  style='float:left;padding-left:30px;'>
														<div onclick='document.getElementById('trailer_popup').style.display='block';' style='cursor:pointer;'><img   src='img/trailer.png' style='float:left;width:20px;height:20px;'><p  style='color:black;font-weight:bold;cursor:pointer;padding-left:30px;' ><b>Watch Trailer</b></p>	</div>
														<p style='font-weight:bold;cursor:pointer;color:black;padding-left:55px;' id='".$PID1."' onclick='moremodeldisplay(this.id);'><b>More</b></p>
													
													</div>
												</div>
													
										                             </div>
							<div class='clearfix'></div>
                          </div>
                         </section> 
                      </div>                      
                    </article>
                   </div>
                  </div>";
	}

	//returning data
	$data			=	array(
							'html'			=>	$html
						);
	//echo json_encode($data);
	echo $html;

}
}
?>

<div style="height:100%;width:100%;z-index:9999;position:fixed;top:0px;left:0px;background-color:rgba(0, 0, 0, 0.44);display:none;" id="more_popup" >

<!--<iframe style="background-color:transparent;" id="more_ifrm"  src="more.php" frameborder="0" height="100%" scrolling="no" width="100%"></iframe>-->
</div>